package com.zhu.mapper;

import com.zhu.pojo.Stock;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StockMapper {
    @Select("select * from stock where model=#{model}")
    public Stock search(String model);

    @Insert("insert into stock (type,model,manufacturer,area) values (#{type},#{model},#{manufacturer},#{area})")
    public void addstock(Stock stock);

    @Select("select * from stock where model like concat('%',#{model},'%')")
    public List<Stock> searchh(String model);

    @Update("update stock set type=#{type},manufacturer=#{manufacturer},area=#{area} where model=#{model}")
    public void edit(Stock s);

    @Delete("delete from stock where model=#{model}")
    public void delete(String model);

    @Select("select name from region")
    public List<String> areas();

}
